if node.isEditable() then
    local txt = node.text
    local gb = node.getTextSelectionEnd()
    local n1, n2 = 0, -1
    if txt and txt ~= "" then
        local tbl = {" ", "\n"}
        -- Tìm vị trí bắt đầu của từ dưới con trỏ
        for n = gb-1, 1, -1 do
            if table.find(tbl, utf8.sub(txt, n, n)) then
                n1 = n
                break
            end
        end
        if gb < utf8.len(txt) then
            for n = gb, utf8.len(txt)-1, 1 do
                if table.find(tbl, utf8.sub(txt, n, n)) then
                    n2 = n
                    break
                end
            end
        end
        local deletedWord = utf8.sub(txt, n1+1, n2)
        txt = n2 == -1 and utf8.sub(txt, 1, n1) or utf8.sub(txt, 1, n1)..utf8.sub(txt, n2+1, -1)
        service.setText(node, txt)
        service.setSelection(node, n1)
        service.speak("đã xoá:"..deletedWord)
    else
        service.speak("không có văn bản")
    end
    return true
end